package com.example.demo.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
public class Complaintype {
    private int ctId;
    private String ctType;
    private List<Complain> ts;


    @Id
    @Column(name = "ct_ID", nullable = false)
    public int getCtId() {
        return ctId;
    }

    public void setCtId(int ctId) {
        this.ctId = ctId;
    }

    @Basic
    @Column(name = "ct_type", nullable = false, length = 10)
    public String getCtType() {
        return ctType;
    }

    public void setCtType(String ctType) {
        this.ctType = ctType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Complaintype that = (Complaintype) o;
        return ctId == that.ctId &&
                Objects.equals(ctType, that.ctType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ctId, ctType);
    }

    @OneToMany(mappedBy = "tsfl")
    public List<Complain> getTs() {
        return ts;
    }

    public void setTs(List<Complain> ts) {
        this.ts = ts;
    }
}
